﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;


namespace Webtest_view.DbFunction
{
    public class dbConnect
    {
        
    public bool insertValues(String query)
    {
        
        SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["conString"].ConnectionString);
        SqlCommand cmd = new SqlCommand(query, conn);
        conn.Open();
        cmd.ExecuteNonQuery();
        
        return true;
    }

    public DataSet Select_Valeus(String query)
    {


        SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["conString"].ConnectionString);
        SqlDataAdapter da = new SqlDataAdapter(query, conn);
        DataSet ds = new DataSet();

        da.Fill(ds);
        return ds;
        
    }

    public void deleteValue(String query)
    {
        SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["conString"].ConnectionString);
        SqlCommand cmd = new SqlCommand(query, conn);
        conn.Open();
        cmd.ExecuteNonQuery();
    
    }
    }
}
